package itdfq.ydd.Structural_Patterns.zuhe;

import java.util.ArrayList;

/**
 * @Author GocChin
 * @Date 2021/4/16 19:18
 * @Blog: itdfq.com
 * @QQ: 909256107
 */
public class Box extends Chai{
    private ArrayList list = new ArrayList();

    public void add(Chai chai){
        list.add(chai);
    }
    public void remove(Chai chai){
        list.remove(chai);
    }
    @Override
    public void chai() {
        for(Object o : list){
            ((Chai)o).chai();
        }
    }
}
